Input devices, such as computer mice, trackballs, sliders, and touch pads, are used to provide user input to a computer program and to control applications and are well known in the art. Such pointing devices typically enable a user to move a cursor on a display screen and are fundamental to programs and operating systems that employ a graphical user interface, such as Microsoft Corporation's WINDOWS™ and Apple Corporation's MACINTOSH™ operating systems. In a typical pointing device, a ball is rotated in the housing of the device, either directly by the user's fingers, or by movement of the device over an underlying surface or pad. Depending upon its direction of rotation, the rotating ball in turn causes one or both of a pair of encoder shafts in the housing to rotate. The encoder shafts rotate about a pair of orthogonal axes, i.e., the “X” and “Y” axes, in response to components of the ball's rotation along those axes. As the encoder shafts rotate, the corresponding encoders produce signals that indicate the device's incremental motion along these orthogonal axes. These signals are processed by a microcontroller or other logic processor in the pointing device, which produces a corresponding stream of digital values indicative of a position of the device relative to the X and Y axes. The displacements are passed to a driver program executing on the computer to which the pointing device is attached. The driver program also receives other input signals from the pointing device, including one or more signals indicative of the state of control buttons on the device. The relative position data and the state of the control buttons are input to a computer program (or the operating system), which processes the information, causing a predefined action to occur. For example, as indicated above, many operating systems move a cursor displayed on a monitor or other display screen in response to the user's movement of the pointing device. The X and/or Y movement of the cursor on the display screen is a function of the motion of the ball (or device) along its respective X and/or Y axes.
In recent years, mouse manufacturers have added a third input axis to their products, commonly known as the “Z” axis. Originally developed by the Microsoft Corporation for use with its WINDOWS™ operating system, this Z-axis control on the mouse has become a popular feature for scrolling pages on a computer screen, zooming a computer display, throttling speed in a computer game, and other activities. The Z-axis control is typically implemented using a detented wheel (the Z-wheel) that is coupled to a rotatable shaft. An encoder monitors rotation of the Z-wheel shaft by a user. Examples of a mouse that has such a wheel are illustrated in Microsoft Corporation's U.S. Pat. No. 5,912,661 entitled “Z-Encoder Mechanism,” U.S. Pat. No. 5,473,344 entitled “3-D Cursor Positioning Device,” and U.S. Pat. No. 6,353,429 entitled “Detented Optical Encoder.”
Such mouse input devices usually monitor wheel movement using linear and/or rotational sensors having variable resistance potentiometers, mechanical quadrature encoders or optical encoders. For a typical optical encoder (prior art), the primary components are shown in FIGS. 1 and 2. These components include a code disk or codewheel 10, an emitter 12, and an integrated detection circuit 14. The codewheel generally comprises a plurality of equally-spaced teeth 16, forming slots 18, which may be fully enclosed. An alternative codewheel may be fabricated using a clear plastic or glass disk imprinted with a radially-spaced pattern of lines, commonly called a “mask.” Codewheel 10 is typically fixed to a shaft 56 that rotates when a Z-wheel 58 is turned by a user. Formed in a portion of shaft 56 may be evenly spaced longitudinal slots 54 that can be used to affect a detent mechanism. As shown in FIG. 1, a common detent mechanism employs a leaf spring 50 with a protrusion 52 on one end that applies a bias force against longitudinal slots 54. As the shaft is rotated, the protrusion, acting under the biasing force of the spring, moves in and out of successive slots, which flexes the spring back and forth, thereby creating a detent action. The even spacing of the slots in the shaft results in the user feeling a plurality of evenly spaced detented positions as the user rotates Z-wheel 58.
Emitter 12 typically comprises a light emitting diode (LED) 20, which emits light rays 21 that are collimated into a parallel beam by a lens 22. Integrated detection circuit 14 is disposed opposite the emitter and typically comprises at least two photodetectors 24. Suitable photodetectors include photodiodes and phototransistors. The set of components comprising the emitter and photodetectors used in an optical encoder is commonly referred to as the encoder's “photo-optics.”
Codewheel 10 is disposed relative to emitter 12 and integrated detection circuit 14 so that when codewheel 10 is rotated, its slotted or lined portion moves between the emitter and integrated detector circuit. Light beam 21 passing from the emitter to integrated detection circuit 14 is thus interrupted by teeth 16 (or by radial lines imprinted) between the pattern of slots 18 on the codewheel. Any portion of the light beam that is not blocked by teeth 16 (or the lines that are imprinted) is detected by photodetectors 24. The photodetectors typically produce an analog output signal that is proportional to the intensity of the light they detect. In general, the output signal produced by each photodetector as the codewheel is turned at a constant rate is sinusoidal. The photodetectors are arranged in a pattern that is a function of the radius and slot or line density of the codewheel, so as to produce a quadrature output that is well known in the art.
As indicated, each photodetector produces an analog output signal applied respectively to a non-inverting Schmitt trigger 32. Schmitt triggers are used to minimize the effects of extraneous noise in the raw signals provided by the phototransistors. Optionally, other types of comparator circuits can be used in place of the Schmitt triggers. The output signals of the Schmitt triggers are input to a microcontroller, which processes the signals on channels A and B using a duty-cycle control algorithm to generate a digital waveform in quadrature, which is further processed by the microcontroller to determine the incremental motion of the encoder wheel. The output from the microcontroller is then passed through a serial communication link to a computer (e.g., through an RS-232 serial port, a universal serial bus (USB) port, or a PS/2 port). A driver in the operating system (or in an application program) processes the output from the microcontroller to control the display and movement of a cursor on the computer monitor screen in response to the movement of the mouse Z-wheel.
In more detail, FIG. 3 (prior art) illustrates functional blocks of an exemplary prior art system to generate encoder wheel position data, as described in U.S. Pat. No. 6,380,927 B1, the disclosure of the specification and drawings of which are hereby specifically incorporated herein by reference. This system comprises three primary components, including a duty-cycle control block 100, a transition determination block 102, and a Z-wheel learning block 104. The duty-cycle control block includes a capture and process block 106, and a sample lookup table 108. The transition determination block comprises a physical-to-logical lookup 110 and a Z/Quad table 112. The input to this system are raw output signals produced by the pair of Schmitt triggers on respective channels A and B, as discussed above. The system output is in the form of a data packet or packets 114, which contain information concerning a relative displacement of the Z-wheel, along with the state of control buttons on the input device in which the Z-wheel is included.
Duty-cycle control block 100 is used to translate the analog phototransistor/Schmitt trigger signals into respective digital channel inputs ZA and ZB. The output signal from a channel's Schmitt trigger will depend on how much of the path along which the collimated light produced by the LED propagates toward the channel's phototransistor is blocked by a codewheel tooth. As shown in FIG. 4 (prior art), when the codewheel is rotated at a constant rate and the LED is continuously turned on, the voltages that are output by the phototransistors appear as sinusoidal waves 120 and 122, which correspond to the output on channels A and B, respectively. Ideally, the two sinusoidal waves will be 90° out of phase, as shown here. Also ideally, the Schmitt triggers will have a threshold voltage level 124 that is one-half of the peak-to-peak voltage 126 of the sinusoidal waves, such that the outputs of the Schmitt triggers are digital waveforms (square waves) similar to waveforms 128 and 130 shown in FIG. 4.
Unfortunately, it is very unlikely that a given photo-optic set (LED, phototransistors, and Schmitt triggers) will produce the waveforms shown in FIG. 4. In actual devices, the threshold level may not be at the midpoint of the peak-to-peak voltage, the phase angle between channels may not be 90°, the output signals produced by the phototransistors may not be symmetric, etc. To address these and other problems, a scheme called duty-cycle encoding was developed.
In the foregoing discussion of optical encoder principles, it was assumed that the LED and photodetectors were always turned on, which works fine for perfectly matched components, but is not a good assumption in the real world. When manufacturing large quantities of pointing devices, unmatched components will likely be used to minimize costs. However, there are some electronics principles that can be applied to the photodetection circuit of FIG. 2 to enable unmatched photo-optic components to produce quadrature waveforms that approach the ideal configuration shown in FIG. 4. In addition to the following discussion, further details concerning the control and processing of signals generated by photo-optic devices as applied in the duty-cycle encoding are disclosed in U.S. Pat. No. 5,256,913, the specification and drawings of which are hereby specifically incorporated herein by reference.
One electronics principle that is helpful in this case takes advantage of the behavior of a transistor when it is forced into an “off state” and then suddenly turned on. Although a phototransistor should (ideally) produce an output that corresponds to the level of light it detects, the output of such devices cannot instantaneously slew to a steady state value. The following analogy is used to illustrate this principle.
Consider filling an empty bucket with water from a faucet. With reference to FIG. 5, the level of the height of the water in the bucket will start at 0, indicating that the bucket is empty, and increase over time until the bucket is filled, at which point, the level will reach a peak, and the water will overflow. The steepness of the curve will depend on the flow rate of the water into the bucket from the faucet. If the faucet has a high volume flow, like that used to feed a fire hose, the curve from zero to full will be steep. However, it is not likely that a water source can fill the bucket instantaneously. In addition, the flow rate does not instantly change to a steady state value and will not likely be reduced just as the bucket becomes full.
In an analogous fashion, the phototransistors in FIG. 2 generate a charge of electrons, based on the intensity of light detected by the phototransistors, which flow as an electrical current to the Schmitt triggers. In accord with the preceding analogy, the LED is like the water supply, and the teeth (or slots between the teeth) of the codewheel are like the faucet that controls the rate at which water flows into the bucket. If the emitter light beam passes through the slots between the teeth, the phototransistor charges quickly. Conversely, if a wheel tooth blocks most of the light, the phototransistor charges very slowly. (Note that even if a phototransistor is completely blocked, it will still produce a certain minimum level of current called its “dark” current.) Ideally, the rate at which a phototransistor is charged should be proportional to the amount of the light beam that is blocked by a tooth. Furthermore, it is possible to “drain” the phototransistors (i.e., remove any charge present at their output) by momentarily coupling their outputs to ground, which in the analogy, is equivalent to opening a large drain hole in the bucket. The purpose of coupling the output signals to ground is to make sure the output signals produced by the phototransistors are initialized to a zero-charge (i.e., an empty bucket) condition.
FIG. 6 (prior art) is a graph showing the voltage output by a given LED phototransistor pair versus time for different levels of blockage of light by the teeth of the codewheel. The various curves represent the voltage outputs corresponding to different rotational positions of the codewheel, wherein higher voltage curves 140, 142, 144, and 146 correspond to codewheel positions that only block a smaller portion of the light from being received by the phototransistor, while lower voltage curves 148, 150, and 152 correspond to codewheel positions that block a substantially greater portion of the light. For instance, curve 140 corresponds to a rotational position of the codewheel where none of the light directed toward the phototransistor is blocked by a tooth; in contrast, curve 152 corresponds to a rotational position in which a tooth is blocking almost all of the light directed toward the phototransistor.
In addition to variations in voltage output due to blockage, the voltage output versus time for an unblocked phototransistor will depend on the particular characteristics of each given photo-optic pair (i.e., LED-phototransistor combination), as shown in FIG. 7 (prior art). The amount of time necessary for a given unblocked phototransistor to produce an output voltage level that crosses a threshold voltage VTH will depend on the electrical characteristics of the phototransistor and its corresponding LED, i.e., the higher the sensitivity of the phototransistor (or more light produced by the LED), the less time will be required to cross the threshold. For instance, higher voltage curves 154 and 156 correspond to photo-optic pairs that include a relatively sensitive phototransistor and/or a LED that produces greater light output, while middle voltage curves 158, 160, and 162 correspond to photo-optic pairs with average sensitivity, and lower voltage curves 164 and 166 correspond to photo-optic pairs with relatively low sensitivity.
As discussed above with reference to FIG. 2, the phototransistor output voltage is applied to the input of a non-inverting Schmitt trigger, which has an internal threshold voltage (the same VTH as above) such that the output from the Schmitt trigger is a “1” if the phototransistor voltage exceeds the threshold, and a “0” if the voltage is less than the threshold. Suppose an evaluation of the signal is made at some fixed time T after turning on the LED and draining the phototransistor. Ideally, if a wheel tooth is in the way, the output from the Schmitt trigger will be a 0, and if the wheel is not blocking or blocking very little light reaching the phototransistor, then the output from the Schmitt trigger will be a 1. If the wheel is moving and samples are repeatedly taken for every time interval T, a percentage of 1s versus 0s will be established. If the time T is well chosen, the ratio of 1s to 0s should be about 1:1. This balance of 1s and 0s will provide evenly-spaced quadrature states that are approximately equal in duration. As a result, it is less likely that a state change will be missed due to a short state transition.
The object of duty-cycle encoding is to control the time-sampling of the phototransistor outputs on each channel such that a sequence of quadrature bits (on each channel) are produced having a 50% duty cycle when the wheel is rotated at a constant velocity, reducing the chance of quadrature states being missed. This object can be accomplished by finding a time T in which to sample the output signals for a given set of photo-optics. The time can be determined in part, by measuring the fastest threshold crossing time, called Tmin, which corresponds to the time for the output voltage of a given set of photo-optics in which the phototransistors are completely uncovered to cross the threshold. The time for a half-covered photodetector signal to cross the threshold can then be estimated by doubling the value of Tmin. This concept can then be extended to predict the amount of blockage present during a given sample. For instance, if samples are taken at intervals of 2Tmin, the output for a given set of photo-optics will be 1s when the photodetector is less than half covered and 0s when the photodetector is more than half covered, which results in the 50% duty cycle.
In summary, duty-cycle encoding is accomplished by determining and reevaluating Tmin and taking samples of the outputs produced by the Schmitt triggers after 2Tmin on a continuous basis. This process repeatedly performs the steps of draining the photodetector outputs, releasing them to charge to a voltage level, turning on the LED, and reading the digital outputs produced by the Schmitt triggers after a delay of 2Tmin. As a result of implementing this process, a quadrature signal similar to that shown in FIG. 4 is produced by combining the digital waveform outputs produced by the Schmitt triggers.
As might be expected, the waveforms produced by the phototransistor/Schmitt trigger/duty-cycle control algorithm scheme of FIGS. 1 and 2 are not especially accurate and clean. Because only one pair of phototransistors is used, instead of one pair for a tooth position and one pair for a slot position, there is a probability that a logic level change (a transition between a high and low voltage level or vice versa) on a channel might be missed, or that a false logic level change might be indicated. Either of these situations would cause the sensed movement of the encoder wheel to differ from the actual movement of the wheel, and the movement of the Z-wheel would thus be inaccurately reflected in the control action implemented by the computer. A popular way to overcome this problem comprises a particular state transition scheme shown in FIGS. 8A and 8B (prior art) that was developed in conjunction with detented Z-wheels. This state transition scheme and an enhanced state scheme are fully described in U.S. Pat. No. 6,380,927 B1, the disclosure of which has above specifically been incorporated herein. In general, however, the state transition scheme illustrated by FIGS. 8A and 8B, requires two electrical state changes for each detent position of the codewheel. This scheme reduces the impact of missed state transitions and false signals, but is still susceptible to many problems.
A primary problem is that this scheme is limited to only four (4) states for resolving a mechanical angular displacement and direction of the codewheel from slot to slot. Sampling the Schmitt triggers after a relatively arbitrary delay of 2Tmin provides only discrete data; namely, a 1 if the LED light beam was sufficiently unobstructed to enable the phototransistor voltage to reach the voltage threshold within 2Tmin, or a 0 if the LED light beam was sufficiently obstructed by a tooth to prevent the phototransistor voltage from reaching the voltage threshold within 2Tmin. Under this scheme, angular displacement resolution is limited to the number of distinguishable teeth and slots arranged around the codewheel. The resolution of angular displacement could be increased by increasing the number of teeth and slots around the same diameter codewheel, and/or by increasing the size of the codewheel. However, the overall size of a manually manipulated input device, such as a mouse, must remain within a limited range for user comfort and control. Correspondingly, the codewheel size must remain limited. Similarly, the number of teeth and slots around the codewheel is limited by the size of the codewheel, the size of the phototransistors, and a minimum distance between the phototransistors needed to distinguish the signal from each phototransistor.
Another approach is to scale the output of the device's microcontroller. For example, a standard mouse driver in Microsoft Corporation's WINDOWS™ operating system multiplies the Z-wheel microcontroller output of a connected mouse by a scale factor of 120, which is referred to as the wheel_scale_multiplier (WSM). The scale factor simply provides a multiplicative increase in the number of codewheel state change counts. Regardless of the value used, the wider range of counts produced by the scale factor provides an artificial way for the operating system or an application program on the host processor to emulate a higher resolution by subdividing, or otherwise modifying a single increment of the codewheel into more than one count. Shifting such scaling to the host processor reduces the processing complexity and the cost of the mouse microcontroller. However, this scaling does not truly increase the number of state change counts per codewheel increment. Thus, this scaling does not truly increase the resolution of the Z-wheel. Also, such individual scaling by the operating system and each application program can cause inconsistent scrolling in multiple windows on the display of a single user. If programs in each window used the scale factor differently, the user would have to adjust to a different scroll rate each time the user changed focus to a different window. Adjusting to, and/or remembering different scroll rates would be distracting. To provide the user with a consistent scroll rate in each window, the operating system and most application programs nullify the scale factor by dividing by 120 before performing a scroll.
As an alternative, the user can control the effect of each increment of the codewheel, which typically corresponds to each detent increment of the Z-wheel. Through a control panel setting, the user may choose to equate one Z-wheel detent increment with scrolling by one full page, or by any number of individual lines (sometimes referred to herein as wheel scroll lines (WSL)). By default, one Z-wheel detent increment is set to scroll three lines. The user can set the WSL to a higher number to scroll more quickly, but the scrolling will be in large disjointed jumps. Alternatively, the user can set the WSL to one or two lines. However, the user would then have to rotate the Z-wheel more times to scroll a large distance. In any case, without some other resolution control, equating a codewheel increment to a number of lines will always result in some jerky motion of the display that is somewhat difficult for the user to visually track. A smooth, higher resolution motion would be preferable, so that the user can easily track the motion visually, yet cover a large distance if necessary without excessive rotation of the Z-wheel or other input device.
Of course, the WSL selection could be modified to allow fractional lines or other very small increments of distance. However, the user would again have to rotate the Z-wheel many times to scroll even a moderate distance. Also, to provide relatively smooth scrolling, the fractional increments would have to be so small that they would loose any meaningful relationship to a user-friendly setting such as the number of lines scrolled per detent increment of the Z-wheel. It is therefore desirable to provide smooth, high resolution control of scrolling (or other functions) with the Z-wheel or other input device, yet maintain a simple relationship between increments of the codewheel and the resulting action.
Smooth scrolling could also be implemented with complex smoothing algorithms that are run on the host computer processor or on a sophisticated processor in the input device. However, burdening the host processor with such input interruptions and additional overhead reduces the overall efficiency of the host computer. Adding a sophisticated processor to the input device drives up the cost of a typically low-cost device. A sophisticated processor in the input device may also require more communication between the input device and the host computer. More communication would likely require higher bandwidth to maintain real-time response to user actions with the input device. Unfortunately, higher bandwidth is expensive and reduces the marketability of such an input device with a sophisticated processor. Thus, it is desirable to improve resolution of an input device without requiring a sophisticated and costly processor in the input device to perform complex calculations, and without artificial scaling and subdividing by the host processor, which would result in a poor relationship to a user-friendly unit of motion.